window.addEventListener('load', function() {

    // use strict mode
    "use strict";

	// Declare Variables
	var ourForm = document.getElementById('ourForm');
	var submitButton = Form.getSubmit('ourForm');
	submitButton.disabled = 'disabled';

	// Check Form Function
	function checkForm() {
		var inputs = ourForm.getElementsByTagName('input');		
		if( Form.validateLength(inputs[0], Form.fName ))
		{
			if(Form.validateLength(inputs[1], Form.lName))
			{
				if(Form.validateEmail(inputs[2]))
				{
					submitButton.disabled = false;
					return true;
				}
			}
		}
		
		submitButton.disabled = 'disabled';
		return false;
	}
	
	checkForm();
	
	ourForm.addEventListener('keyup', checkForm, false);
	ourForm.addEventListener('submit', checkForm, false);

}, false);
